package com.liu.voluntary.util;

import org.apache.commons.codec.digest.DigestUtils;


public class MD5Util {

    public static String md5(String src){
        return DigestUtils.md5Hex(src);
    }




    //第一次加密
    public static String inputPassToMidPass(String inputPass){

       return md5(inputPass);
    }

    //第二次加密,把中间密码加密为数据库存储密码
    public static String midPassToDBPass(String midPass){

       return md5(midPass);

    }


    //将用户输入的明文密码转换为数据库中存储的密码
    public static String inputPassToDBPass(String inputPass){

        String midPass = inputPassToMidPass(inputPass);
        String dbPass = midPassToDBPass(midPass);

        return dbPass;

    }


}
